***                                                                                                                                                                                                                                                       
***                                                                                                                                                                                                                                                       
*** This Program already converted to Y2K                                                                                                                                                                                                                 
*** S&T Departement     on 29 April 1999 by Ben.Rahman                                                                                                                                                                                                    
***                                                                                                                                                                                                                                                       
***                                                                                                                                                                                                                                                       
set cent on                                                                                                                                                                                                                                               
*rest from n:report                                                                                                                                                                                                                                       
*AWAL=PRIBEG+1                                                                                                                                                                                                                                            
*TGL=PRITGL+1                                                                                                                                                                                                                                             
*REPRI=0                                                                                                                                                                                                                                                  
*IF PRIREV                                                                                                                                                                                                                                                
*   REPRI=1                                                                                                                                                                                                                                               
*ENDIF                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                          
tgl=date()-1                                                                                                                                                                                                                                              
do while .t.                                                                                                                                                                                                                                              
   @ 10, 48 SAY 'Transaction Date : ' get tgl pict '99/99/9999'                                                                                                                                                                                           
   read                                                                                                                                                                                                                                                   
   if tgl>=date()                                                                                                                                                                                                                                         
      loop                                                                                                                                                                                                                                                
   endif                                                                                                                                                                                                                                                  
   exit                                                                                                                                                                                                                                                   
enddo                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                          
IF MONTH(DATE())<>MONTH(TGL)                                                                                                                                                                                                                              
   DR  = 'Q:'                                                                                                                                                                                                                                             
   DR2 = 'N:'                                                                                                                                                                                                                                             
   F1  = 'REVENU2V'                                                                                                                                                                                                                                       
   F2  = 'ACT_PR2V'                                                                                                                                                                                                                                       
   F3  = 'ACT_PH2V'                                                                                                                                                                                                                                       
   F4  = 'PATIENT'                                                                                                                                                                                                                                        
ELSE                                                                                                                                                                                                                                                      
   DR  = 'N:'                                                                                                                                                                                                                                             
   DR2 = 'N:'                                                                                                                                                                                                                                             
   F1  = 'REVENUEV'                                                                                                                                                                                                                                       
   F2  = 'ACT_PROV'                                                                                                                                                                                                                                       
   F3  = 'ACT_PHAV'                                                                                                                                                                                                                                       
   F4  = 'PATIENT'                                                                                                                                                                                                                                        
ENDIF                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                          
SELE 1                                                                                                                                                                                                                                                    
SET EXCLU OFF                                                                                                                                                                                                                                             
USE &DR&F1                                                                                                                                                                                                                                                
SELE 2                                                                                                                                                                                                                                                    
SET EXCLU OFF                                                                                                                                                                                                                                             
USE &DR&F2                                                                                                                                                                                                                                                
SELE 3                                                                                                                                                                                                                                                    
SET EXCLU OFF                                                                                                                                                                                                                                             
USE &DR&F3                                                                                                                                                                                                                                                
SELE 4                                                                                                                                                                                                                                                    
SET EXCLU OFF                                                                                                                                                                                                                                             
USE &DR2&F4 INDE &DR2&F4                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                          
SELE 1                                                                                                                                                                                                                                                    
*tanggal=date()                                                                                                                                                                                                                                           
*if tgl=date()                                                                                                                                                                                                                                            
*   save all like pri* to n:report                                                                                                                                                                                                                        
*   return                                                                                                                                                                                                                                                
*endif                                                                                                                                                                                                                                                    
store 0 to pl1,pl2,pl3,fl,CTR,hl,ttL,ttl1,ttl2,ttl3,ttl4,ttl5,TOTFEE,TOTPRO,TOTPHA,TOTHL,TOTPAY,TOTCAS,TOTCRD,TOTCAR,TOTCEK,TOTEMPL,TOTHNF,TOTMS                                                                                                          
do while pl1=0                                                                                                                                                                                                                                            
   @ 12,60 say '/'                                                                                                                                                                                                                                        
   @ 12,54 prompt 'Print'                                                                                                                                                                                                                                 
   @ 12,62 prompt 'Display'                                                                                                                                                                                                                               
   @ 12,70 say '/'                                                                                                                                                                                                                                        
   @ 12,72 PROMPT 'Quit'                                                                                                                                                                                                                                  
   menu to pl1                                                                                                                                                                                                                                            
   if pl1=3                                                                                                                                                                                                                                               
      RETN=.T.                                                                                                                                                                                                                                            
      return                                                                                                                                                                                                                                              
   else                                                                                                                                                                                                                                                   
      if pl1=2                                                                                                                                                                                                                                            
         LY=SAVESCREEN(0,0,24,79)                                                                                                                                                                                                                         
         do lsrev                                                                                                                                                                                                                                         
         RESTSCREEN(0,0,24,79,LY)                                                                                                                                                                                                                         
         return                                                                                                                                                                                                                                           
      else                                                                                                                                                                                                                                                
         @ 14,60 say '/'                                                                                                                                                                                                                                  
         @ 14,46 prompt 'Printer Ready'                                                                                                                                                                                                                   
         @ 14,62 prompt 'Not Yet Ready'                                                                                                                                                                                                                   
         menu to pl2                                                                                                                                                                                                                                      
         if pl2=2                                                                                                                                                                                                                                         
            @ 14,46 clea to 14,78                                                                                                                                                                                                                         
            pl1=0                                                                                                                                                                                                                                         
         else                                                                                                                                                                                                                                             
            @ 16,46 say '        Printing...    '                                                                                                                                                                                                         
            set console off                                                                                                                                                                                                                               
            set devi to prin                                                                                                                                                                                                                              
         endif                                                                                                                                                                                                                                            
      endif                                                                                                                                                                                                                                               
   endif                                                                                                                                                                                                                                                  
enddo                                                                                                                                                                                                                                                     
br=100                                                                                                                                                                                                                                                    
set devi to print                                                                                                                                                                                                                                         
@ 0,0 say chr(15) pict 'x'                                                                                                                                                                                                                                
SELE 1                                                                                                                                                                                                                                                    
SET EXCLU OFF                                                                                                                                                                                                                                             
USE &DR&F1                                                                                                                                                                                                                                                
go top                                                                                                                                                                                                                                                    
do while .not. eof()                                                                                                                                                                                                                                      
   store 0 to med,den,xry,lab,tot,pres,CTRR                                                                                                                                                                                                               
   LOCATE FOR DATE_VISIT=TGL                                                                                                                                                                                                                              
   IF .NOT. FOUND()                                                                                                                                                                                                                                       
      CONTINUE                                                                                                                                                                                                                                            
      IF EOF()                                                                                                                                                                                                                                            
         EXIT                                                                                                                                                                                                                                             
      ENDIF                                                                                                                                                                                                                                               
   ELSE                                                                                                                                                                                                                                                   
*      AWAL=AWAL+1                                                                                                                                                                                                                                        
*      CTRR=CTRR+1                                                                                                                                                                                                                                        
      if br>57                                                                                                                                                                                                                                            
         if fl>0                                                                                                                                                                                                                                          
            eject                                                                                                                                                                                                                                         
         else                                                                                                                                                                                                                                             
            fl=1                                                                                                                                                                                                                                          
         endif                                                                                                                                                                                                                                            
         cl=50                                                                                                                                                                                                                                            
         hl=hl+1                                                                                                                                                                                                                                          
         a='VOID CLINIC REVENUE REPORT for '+dtoc(TGL)                                                                                                                                                                                                    
         @  0, 34 SAY CHR(27)+'G'                                                                                                                                                                                                                         
         @  0, 34 say a                                                                                                                                                                                                                                   
         @  0, 34 SAY CHR(27)+'H'                                                                                                                                                                                                                         
         @  0, 80 say "Page #"                                                                                                                                                                                                                            
         @  0, 86 say hl pict "99"                                                                                                                                                                                                                        
         br=2                                                                                                                                                                                                                                             
      endif                                                                                                                                                                                                                                               
      br=br+1                                                                                                                                                                                                                                             
      do while .not. eof()                                                                                                                                                                                                                                
         if date_visit<>tgl                                                                                                                                                                                                                               
            skip                                                                                                                                                                                                                                          
            loop                                                                                                                                                                                                                                          
         else                                                                                                                                                                                                                                             
            IF BR>61                                                                                                                                                                                                                                      
               EJECT                                                                                                                                                                                                                                      
               hl=hl+1                                                                                                                                                                                                                                    
               @  0, 34 SAY CHR(27)+'G'                                                                                                                                                                                                                   
               @  0, 34 say a                                                                                                                                                                                                                             
               @  0, 34 SAY CHR(27)+'H'                                                                                                                                                                                                                   
               @  0, 80 say "Page #"                                                                                                                                                                                                                      
               @  0, 86 say hl pict "99"                                                                                                                                                                                                                  
               br=2                                                                                                                                                                                                                                       
            ENDIF                                                                                                                                                                                                                                         
            ctr=ctr+1                                                                                                                                                                                                                                     
            INV=INV_NBER                                                                                                                                                                                                                                  
            @ BR,  0 SAY "Patient #"                                                                                                                                                                                                                      
            @ br, 10 say ctr pict "999"                                                                                                                                                                                                                   
            @ br, 15 say "Invoice :"                                                                                                                                                                                                                      
            @ br, 25 say inv_nber pict "99999"                                                                                                                                                                                                            
            @ BR, 32 SAY "Code : "+PAT_FILCOD+" "+PAT_CODTYP                                                                                                                                                                                              
            KODE=PAT_FILCOD                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                          
            COMP=SPAC(36)                                                                                                                                                                                                                                 
            SELE 4                                                                                                                                                                                                                                        
            SEEK KODE                                                                                                                                                                                                                                     
            IF .NOT. EOF()                                                                                                                                                                                                                                
               COMP = JOB_CORP                                                                                                                                                                                                                            
            ENDI                                                                                                                                                                                                                                          
            SELE 1                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                          
            @ BR, 50 SAY "Name : "+trim(PAT_F_NAME)+" "+pat_name                                                                                                                                                                                          
            IF LEFT(INV_NBER,1)='H'                                                                                                                                                                                                                       
               @ BR,82 SAY ' *'+ALLTRIM(COMP)                                                                                                                                                                                                             
               BR=BR+1                                                                                                                                                                                                                                    
               TOTHNF=TOTHNF+TOTAL_FEE                                                                                                                                                                                                                    
               @ BR, 2 SAY 'Charged :'                                                                                                                                                                                                                    
               DO SAYG WITH BR,12,TOTAL_FEE,'9,999.99','999,999'                                                                                                                                                                                          
*               @ BR,12 SAY TOTAL_FEE PICT '999,999'                                                                                                                                                                                                      
            ELSE                                                                                                                                                                                                                                          
               do case                                                                                                                                                                                                                                    
                  case med_schm                                                                                                                                                                                                                           
                     @ br,82 say 'MEDICAL SCHEME MEMBER'+' *'+ALLTRIM(COMP)                                                                                                                                                                               
                  case healthline=.t. .and. hl_dent=.t.                                                                                                                                                                                                   
                     @ BR, 82 SAY "HEALTHLINE/DENTAL"+' *'+ALLTRIM(COMP)                                                                                                                                                                                  
                  case healthline=.t. .and. hl_dent=.f.                                                                                                                                                                                                   
                     @ BR, 82 SAY "HEALTHLINE"+' *'+ALLTRIM(COMP)                                                                                                                                                                                         
                  CASE HEALTHLINE=.F.                                                                                                                                                                                                                     
                     @ BR, 82 SAY  "         "+' *'+ALLTRIM(COMP)                                                                                                                                                                                         
               ENDCASE                                                                                                                                                                                                                                    
               br=br+1                                                                                                                                                                                                                                    
               @ br, 2 say "Charged :"                                                                                                                                                                                                                    
               IF TOTAL_FEE<1000000                                                                                                                                                                                                                       
                  DO SAYG WITH BR,12,TOTAL_FEE,'9,999.99','999,999'                                                                                                                                                                                       
*                  @ BR,12 SAY TOTAL_FEE PICT '999,999'                                                                                                                                                                                                   
               ELSE                                                                                                                                                                                                                                       
                  DO SAYG WITH BR,12,TOTAL_FEE,'99,999.99','9,999,999'                                                                                                                                                                                    
*                  @ BR,12 SAY TOTAL_FEE PICT '9,999,999'                                                                                                                                                                                                 
               ENDIF                                                                                                                                                                                                                                      
               @ br,26 say "Medical :"                                                                                                                                                                                                                    
               IF TOTAL_PROC<1000000                                                                                                                                                                                                                      
                  DO SAYG WITH BR,36,TOTAL_PROC,'9,999.99','999,999'                                                                                                                                                                                      
*                  @ BR,36 SAY TOTAL_PROC PICT '999,999'                                                                                                                                                                                                  
               ELSE                                                                                                                                                                                                                                       
                  DO SAYG WITH BR,36,TOTAL_PROC,'99,999.99','9,999,999'                                                                                                                                                                                   
*                  @ BR,36 SAY TOTAL_PROC PICT '9,999,999'                                                                                                                                                                                                
               ENDIF                                                                                                                                                                                                                                      
               @ br,50 say "Pharmacy :"                                                                                                                                                                                                                   
               IF TOTAL_PHAR<1000000                                                                                                                                                                                                                      
                  DO SAYG WITH BR,61,TOTAL_PHAR,'9,999.99','999,999'                                                                                                                                                                                      
*                  @ BR,61 SAY TOTAL_PHAR PICT '999,999'                                                                                                                                                                                                  
               ELSE                                                                                                                                                                                                                                       
                  DO SAYG WITH BR,61,TOTAL_PHAR,'99,999.99','9,999,999'                                                                                                                                                                                   
*                  @ BR,61 SAY TOTAL_PHAR PICT '9,999,999'                                                                                                                                                                                                
               ENDIF                                                                                                                                                                                                                                      
               @ BR,75 SAY '<< '+ALLTRIM(CASH_NAME)+' >>'                                                                                                                                                                                                 
               br=br+1                                                                                                                                                                                                                                    
               @ br, 2 say "Healthline :"                                                                                                                                                                                                                 
               IF TOTAL_HL<1000000                                                                                                                                                                                                                        
                  DO SAYG WITH BR,15,TOTAL_HL,'9,999.99','999,999'                                                                                                                                                                                        
*                  @ BR,15 SAY TOTAL_HL PICT '999,999'                                                                                                                                                                                                    
               ELSE                                                                                                                                                                                                                                       
                  DO SAYG WITH BR,15,TOTAL_HL,'99,999.99','9,999,999'                                                                                                                                                                                     
*                  @ BR,15 SAY TOTAL_HL PICT '9,999,999'                                                                                                                                                                                                  
               ENDIF                                                                                                                                                                                                                                      
               @ BR,30 SAY 'Medical Scheme :'                                                                                                                                                                                                             
               IF TOTAL_MS<1000000                                                                                                                                                                                                                        
                  DO SAYG WITH BR,47,TOTAL_MS,'9,999.99','999,999'                                                                                                                                                                                        
*                  @ BR,47 SAY TOTAL_MS PICT '999,999'                                                                                                                                                                                                    
               ELSE                                                                                                                                                                                                                                       
                  DO SAYG WITH BR,47,TOTAL_MS,'99,999.99','9,999,999'                                                                                                                                                                                     
*                  @ BR,47 SAY TOTAL_MS PICT '9,999,999'                                                                                                                                                                                                  
               ENDIF                                                                                                                                                                                                                                      
               @ br,60 say "Invoiced :"                                                                                                                                                                                                                   
               IF TOTAL_PAY<1000000                                                                                                                                                                                                                       
                  DO SAYG WITH BR,71,TOTAL_PAY,'9,999.99','999,999'                                                                                                                                                                                       
*                  @ BR,71 SAY TOTAL_PAY PICT '999,999'                                                                                                                                                                                                   
               ELSE                                                                                                                                                                                                                                       
                  DO SAYG WITH BR,71,TOTAL_PAY,'99,999.99','9,999,999'                                                                                                                                                                                    
*                  @ BR,71 SAY TOTAL_PAY PICT '9,999,999'                                                                                                                                                                                                 
               ENDIF                                                                                                                                                                                                                                      
               TOTPRO=TOTPRO+TOTAL_PROC                                                                                                                                                                                                                   
               TOTPHA=TOTPHA+TOTAL_PHAR                                                                                                                                                                                                                   
               TOTHL=TOTHL+TOTAL_HL                                                                                                                                                                                                                       
               TOTMS=TOTMS+TOTAL_MS                                                                                                                                                                                                                       
            ENDIF                                                                                                                                                                                                                                         
            br=br+1                                                                                                                                                                                                                                       
            @ BR, 2 SAY PAY_MODE                                                                                                                                                                                                                          
            @ br,12 say "Cash :"                                                                                                                                                                                                                          
            IF TOTAL_PAY<1000000                                                                                                                                                                                                                          
               DO SAYG WITH BR,19,TOTAL_CASH,'9,999.99','999,999'                                                                                                                                                                                         
*               @ BR,19 SAY TOTAL_cash PICT '999,999'                                                                                                                                                                                                     
            ELSE                                                                                                                                                                                                                                          
               DO SAYG WITH BR,19,TOTAL_CASH,'99,999.99','9,999,999'                                                                                                                                                                                      
*               @ BR,19 SAY TOTAL_cash PICT '9,999,999'                                                                                                                                                                                                   
            ENDIF                                                                                                                                                                                                                                         
            @ br,34 say "Credit :"                                                                                                                                                                                                                        
            IF TOTAL_PAY<1000000                                                                                                                                                                                                                          
               DO SAYG WITH BR,44,TOTAL_CRED,'9,999.99','999,999'                                                                                                                                                                                         
*               @ BR,44 SAY TOTAL_cred PICT '999,999'                                                                                                                                                                                                     
            ELSE                                                                                                                                                                                                                                          
               DO SAYG WITH BR,44,TOTAL_CRED,'99,999.99','9,999,999'                                                                                                                                                                                      
               @ BR,44 SAY TOTAL_cred PICT '9,999,999'                                                                                                                                                                                                    
            ENDIF                                                                                                                                                                                                                                         
            IF PAY_MODE='CHEQUE' .OR. PAY_MODE='CARD'                                                                                                                                                                                                     
               @ BR,60 SAY PAY_ON                                                                                                                                                                                                                         
               @ BR,80 SAY PAY_NBER                                                                                                                                                                                                                       
            ENDIF                                                                                                                                                                                                                                         
            TOTFEE=TOTFEE+TOTAL_FEE                                                                                                                                                                                                                       
            TOTPAY=TOTPAY+TOTAL_PAY                                                                                                                                                                                                                       
            TOTCRD=TOTCRD+TOTAL_CRED                                                                                                                                                                                                                      
            IF PAT_CODTYP='0' .OR. PAT_CODTYP='9'                                                                                                                                                                                                         
               TOTEMPL=TOTEMPL+(TOTAL_FEE-TOTAL_PAY)                                                                                                                                                                                                      
            ENDIF                                                                                                                                                                                                                                         
            DO CASE                                                                                                                                                                                                                                       
               CASE pay_mode='CASH'                                                                                                                                                                                                                       
                  TOTCAS=TOTCAS+TOTAL_CASH                                                                                                                                                                                                                
               CASE pay_mode='CHEQUE'                                                                                                                                                                                                                     
                  TOTCEK=TOTCEK+TOTAL_CASH                                                                                                                                                                                                                
               CASE pay_mode='CARD'                                                                                                                                                                                                                       
                  TOTCAR=TOTCAR+TOTAL_CASH                                                                                                                                                                                                                
            ENDCASE                                                                                                                                                                                                                                       
            BR=BR+2                                                                                                                                                                                                                                       
            SW1=0                                                                                                                                                                                                                                         
         ENDIF                                                                                                                                                                                                                                            
         SELE 1                                                                                                                                                                                                                                           
         SKIP                                                                                                                                                                                                                                             
      ENDDO                                                                                                                                                                                                                                               
   ENDIF                                                                                                                                                                                                                                                  
ENDDO                                                                                                                                                                                                                                                     
if br>45                                                                                                                                                                                                                                                  
   EJECT                                                                                                                                                                                                                                                  
   hl=hl+1                                                                                                                                                                                                                                                
   @  0, 34 SAY CHR(27)+'G'                                                                                                                                                                                                                               
   @  0, 34 say a                                                                                                                                                                                                                                         
   @  0, 34 SAY CHR(27)+'H'                                                                                                                                                                                                                               
   @  0, 80 say "Page #"                                                                                                                                                                                                                                  
   @  0, 86 say hl pict "99"                                                                                                                                                                                                                              
   br=2                                                                                                                                                                                                                                                   
ENDIF                                                                                                                                                                                                                                                     
@ BR+1, 4 SAY "LAST VISIT RECORDED for "+DTOC(TGL)                                                                                                                                                                                                        
IF AEADECI                                                                                                                                                                                                                                                
   @ BR+2, 4 SAY 'TOTAL NUMBER OF VISITS       : '+STR(CTR,4)                                                                                                                                                                                             
   @ BR+4, 4 SAY 'GRAND TOTAL FEE              : '+TRANS(TOTFEE,'##,###,###,###.##')                                                                                                                                                                      
   @ BR+5, 4 SAY 'GRAND TOTAL PROCEDURE        : '+TRANS(TOTPRO,'##,###,###,###.##')                                                                                                                                                                      
   @ BR+6, 4 SAY 'GRAND TOTAL PHARMACY         : '+TRANS(TOTPHA,'##,###,###,###.##')                                                                                                                                                                      
   @ BR+7, 4 SAY 'GRAND TOTAL HEATHLINE        : '+TRANS(TOTHL,'##,###,###,###.##')                                                                                                                                                                       
   @ BR+8, 4 SAY 'GRAND TOTAL MEDICAL SCHEME   : '+TRANS(TOTMS,'##,###,###,###.##')                                                                                                                                                                       
   @ BR+9, 4 SAY 'GRAND TOTAL HEALTH & FITNESS : '+TRANS(TOTHNF,'##,###,###,###.##')                                                                                                                                                                      
   @ BR+10,4 SAY 'GRAND TOTAL F.O.C. EMPLOYEES : '+TRANS(TOTEMPL,'##,###,###,###.##')                                                                                                                                                                     
   @ BR+11,4 SAY 'GRAND TOTAL CHARGEABLE       : '+TRANS(TOTPAY,'##,###,###,###.##')                                                                                                                                                                      
   @ BR+12,4 SAY 'GRAND TOTAL CASH             : '+TRANS(TOTCAS,'##,###,###,###.##')                                                                                                                                                                      
   @ BR+13,4 SAY 'GRAND TOTAL CHEQUE           : '+TRANS(TOTCEK,'##,###,###,###.##')                                                                                                                                                                      
   @ BR+14,4 SAY 'GRAND TOTAL CREDIT CARD      : '+TRANS(TOTCAR,'##,###,###,###.##')                                                                                                                                                                      
   @ BR+15,4 SAY 'GRAND TOTAL CREDIT           : '+TRANS(TOTCRD,'##,###,###,###.##')                                                                                                                                                                      
ELSE                                                                                                                                                                                                                                                      
   @ BR+2, 4 SAY 'TOTAL NUMBER OF VISITS       : '+STR(CTR,4)                                                                                                                                                                                             
   @ BR+4, 4 SAY 'GRAND TOTAL FEE              : '+TRANS(TOTFEE,'##,###,###,###')                                                                                                                                                                         
   @ BR+5, 4 SAY 'GRAND TOTAL PROCEDURE        : '+TRANS(TOTPRO,'##,###,###,###')                                                                                                                                                                         
   @ BR+6, 4 SAY 'GRAND TOTAL PHARMACY         : '+TRANS(TOTPHA,'##,###,###,###')                                                                                                                                                                         
   @ BR+7, 4 SAY 'GRAND TOTAL HEATHLINE        : '+TRANS(TOTHL,'##,###,###,###')                                                                                                                                                                          
   @ BR+8, 4 SAY 'GRAND TOTAL MEDICAL SCHEME   : '+TRANS(TOTMS,'##,###,###,###')                                                                                                                                                                          
   @ BR+9, 4 SAY 'GRAND TOTAL HEALTH & FITNESS : '+TRANS(TOTHNF,'##,###,###,###')                                                                                                                                                                         
   @ BR+10,4 SAY 'GRAND TOTAL F.O.C. EMPLOYEES : '+TRANS(TOTEMPL,'##,###,###,###')                                                                                                                                                                        
   @ BR+11,4 SAY 'GRAND TOTAL CHARGEABLE       : '+TRANS(TOTPAY,'##,###,###,###')                                                                                                                                                                         
   @ BR+12,4 SAY 'GRAND TOTAL CASH             : '+TRANS(TOTCAS,'##,###,###,###')                                                                                                                                                                         
   @ BR+13,4 SAY 'GRAND TOTAL CHEQUE           : '+TRANS(TOTCEK,'##,###,###,###')                                                                                                                                                                         
   @ BR+14,4 SAY 'GRAND TOTAL CREDIT CARD      : '+TRANS(TOTCAR,'##,###,###,###')                                                                                                                                                                         
   @ BR+15,4 SAY 'GRAND TOTAL CREDIT           : '+TRANS(TOTCRD,'##,###,###,###')                                                                                                                                                                         
ENDIF                                                                                                                                                                                                                                                     
@ BR+16,50 SAY "END OF REPORT"                                                                                                                                                                                                                            
@ BR+17,10 say "Copy # 1 : Dr. Inge"                                                                                                                                                                                                                      
@ BR+18,10 say "Copy # 2 : C. Bond"                                                                                                                                                                                                                       
@ BR+19,10 say "Copy # 3 : Billing"                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                          
@ BR+20,0 SAY CHR(27)+'G'                                                                                                                                                                                                                                 
@ BR+20,0 say repl('-',114)                                                                                                                                                                                                                               
@ BR+20,0 SAY CHR(27)+'H'                                                                                                                                                                                                                                 
BR=100                                                                                                                                                                                                                                                    
*prirev=.t.                                                                                                                                                                                                                                               
*if prirev .and. priact  .and. priabn                                                                                                                                                                                                                     
*   PRIBEG=VAL(INV)                                                                                                                                                                                                                                       
*   PRITGL=TGL                                                                                                                                                                                                                                            
*   stor .f. to prirev                                                                                                                                                                                                                                    
*   stor .f. to priact                                                                                                                                                                                                                                    
*   stor .f. to priabn                                                                                                                                                                                                                                    
*endif                                                                                                                                                                                                                                                    
*save all like pri* to n:report                                                                                                                                                                                                                           
EJECT                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                          
*IF REPRI=0                                                                                                                                                                                                                                               
*   REST FROM N:MONTHREV  addi                                                                                                                                                                                                                            
*   MONVIS=MONVIS+CTR                                                                                                                                                                                                                                     
*   MONFEE=MONFEE+TOTFEE                                                                                                                                                                                                                                  
*   MONPRO=MONPRO+TOTPRO                                                                                                                                                                                                                                  
*   MONPHA=MONPHA+TOTPHA                                                                                                                                                                                                                                  
*   MONHL=MONHL+TOTHL                                                                                                                                                                                                                                     
*   MONMS=MONMS+TOTMS                                                                                                                                                                                                                                     
*   MONPAY=MONPAY+TOTPAY                                                                                                                                                                                                                                  
*   MONCAS=MONCAS+TOTCAS                                                                                                                                                                                                                                  
*   MONCAR=MONCAR+TOTCAR                                                                                                                                                                                                                                  
*   MONCEK=MONCEK+TOTCEK                                                                                                                                                                                                                                  
*   MONCRD=MONCRD+TOTCRD                                                                                                                                                                                                                                  
*   MONEMPL=MONEMPL+TOTEMPL                                                                                                                                                                                                                               
*   SAVE ALL LIKE MON* TO N:MONTHREV                                                                                                                                                                                                                      
*ENDIF                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                          
@ 0,0 SAY CHR(18) PICT 'X'                                                                                                                                                                                                                                
SET DEVI TO SCREEN                                                                                                                                                                                                                                        
CLOSE DATA                                                                                                                                                                                                                                                
CLOSE INDEX                                                                                                                                                                                                                                               
RETURN                                                                                                                                                                                                                                                    
